import Http, {HttpParamsProps, ReqProps} from "@/common/http";
import {BaseEntitys} from "@/common/httptypes";


//后期需整改数据-没用的删掉
export type SysAdminEntity = {
    address: string
    deptName: string
    email: string
    headerPic: string
    id: string
    mobile: string
    password: string
    realName: string
    roleName: string
    sex: string
    status: string
    type: string
    username: string
} & BaseEntitys


class SysAdmin {
    RowKey = "id"
    EDIT = "userManagementEdit"
    ADD = "userManagementAdd" 
    DEL = "userManagementDelete"
    MAPPING = {userManagementEdit: "编辑人员", userManagementAdd: "新增人员"}


    selectTablePage(props: HttpParamsProps): Promise<Response> {
        return Http.get("/user/select", props)
    }

    doEdit(props: ReqProps<void>) {
        Http.doPost("/user/updateById", props)
    }

    delete(props: ReqProps<void>) {
        Http.doDelete("/user/deleteById", props)
    }

    userTypeList(props: ReqProps<[]>) {
        Http.doGet("/api/admin/find", props)
    }

}

// eslint-disable-next-line import/no-anonymous-default-export
export default new SysAdmin()